package com.example.crm_system.mapper;

import com.example.crm_system.entity.Customer;
import com.example.crm_system.entity.Params;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


import java.util.List;

@Mapper
public interface CustomerMapper {

    // 插入customer（cname，gender，age，phone，address）
    void insert(Customer customer);

    // 修改customer
    void update(Customer customer);

    // 删除customer
    void delete(Integer cno);

    // 查询所有customer
    List<Customer> selectAll();

    // 通过cno查询customer
    List<Customer> selectByCno(Integer cno);

    List<Customer> searchCustomer(@Param("params") Params params);

    Customer selectByPhone(@Param("phone") String phone);
}
